package cn.gson.oasys.service;

import cn.gson.oasys.mapper.AoaPlanListMapper;
import cn.gson.oasys.pojo.AoaPlanList;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2020/11/27.
 * 查询所有计划列表
 * 王义
 */
@Service
public class AoaPlanListService {
    @Resource
    private AoaPlanListMapper mapper;
    /*
    * 查询全部计划列表
    * 王义
    * */
    public List<AoaPlanList> SelectByPlanList(){
        return mapper.getByPlanList();
    }

    /*
    *
    * 根据条件查询计划列表
    * */
    public List<AoaPlanList> selectPlanListByOrder(String typeName,String title, String statusName,
                                                   String deptName){
        return mapper.getPlanListByOrder(typeName,title,statusName,deptName);
    }

    /*
    * 根据planid修改计划列表
    * */
    public int updataPlanByPlanId(Long planId, String typeName, String title, Date createTime,
                                  String planComment, Date endTime, String planSummary, String label, String statusName, String planContent){
        return mapper.updataPlanListByPlanId(planId,typeName,title,createTime,planComment,endTime,planSummary,label,statusName,planContent);
    }

    /*
    * 新增计划数据
    * */
    public int addPlan(AoaPlanList aoaPlanList){
        return mapper.addPlanList(aoaPlanList);
    }

    /*
    * 删除表数据
    * */
    public int delPlanListByPlanId(Long planId){
        return mapper.deletePlanList(planId);
    }

    /*
    * 查询计划报表
    * */
    public List<AoaPlanList> getAllAoaPlanList(AoaPlanList aoaPlanList){
        return mapper.selectAllPlanList(aoaPlanList);
    }

    /*
    * 根据用户名进行模糊查询
    * */
    public List<AoaPlanList> getPlanListByRealName(String realName){
        return mapper.selectPlanListByRealName(realName);
    }
}
